package net.sf.midollo.io.lcdui.textbox;

import java.io.IOException;

import javax.microedition.lcdui.TextBox;

import net.sf.midollo.io.IOStream;
import net.sf.midollo.io.IOStreamFactory;

public class TextBoxIOStreamFactory implements IOStreamFactory {

  protected TextBox inputTextBox;
  protected TextBox outputTextBox;

  public TextBoxIOStreamFactory(TextBox textBox) {
    this(textBox, textBox);
  }

  public TextBoxIOStreamFactory(TextBox inputTextBox, TextBox outputTextBox) {
    this.inputTextBox = inputTextBox;
    this.outputTextBox = outputTextBox;
  }

  public IOStream open() throws IOException {
    return new TextBoxIOStream(this.inputTextBox, this.outputTextBox);
  }
}
